﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Configuration;
using System.Web.Configuration;

namespace AdvCMS.Controllers
{
    public class BaseController : Controller
    {
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {

            Configuration config = WebConfigurationManager.OpenWebConfiguration("~");
            ConnectionStringsSection section = config.GetSection("connectionStrings") as ConnectionStringsSection;
            if (section != null)
            {
                if (section.ConnectionStrings["AdvCMS.Data.Linq.Properties.Settings.AdvCMSConnectionString"] == null)
                {
                    requestContext.HttpContext.Response.Redirect("~/Install");

                
                }
            }
            base.Initialize(requestContext);
        }

    }
}
